<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'新建产品'))}
	<div class="frame">
		<form method='post' id="form_data" name="form_data" enctype="multipart/form-data" class="row">
			<input type="hidden" id="ajax" name="ajax" value="0">
			<input type="hidden" id="folder" name="folder" value="{$folder}">
			<input type="hidden" id="fid" name="fid" value="{$folder}">
			<input type="hidden" id="opmode" name="opmode" value="add">
			<div class="box col-6">
				<label class="input-label" for="name">名称：</label>
				<input class="input" type="text" id="name" name="name" value=""  check="required" info="请输入名称">
			</div>
			<div class="box col-6">
				<label class="input-label" for="code">编码：</label>
				<input class="input" type="text" id="code" name="code" value=""  check="required" info="请输入编码">
			</div>
			<div class="box col-6">
				<label class="input-label" for="spec">规格：</label>
				<input class="input" type="text" id="spec" name="spec" value="">
			</div>
			<div class="box col-6">
				<label class="input-label" for="keywords">关键词：</label>
				<input class="input" type="text" id="keywords" name="keywords" value="" >
			</div>			
			<foreach name="field_list" id="udf_vo">
				{:widget('user_define_field/edit',array($udf_vo))}
			</foreach>
			<div class="box col-12">
				<label class="input-label" for="name">描述：</label>
				<textarea class="editor" id="content" name="content" style="width:100%;height:200px;" check="required" info="请输入内容"></textarea>
			</div>
			<div class="box col-12">
				<label class="input-label" for="name">附件：</label>
				{:widget('file_upload/add')}
			</div>
			<div class="box col-12">
				<label class="input-label"></label>
				<a class="btn btn-normal" onclick="save()">保存</a>
				<a class="btn btn-return" onclick="go_return_url()">取消 </a>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global', 'uploader', 'editor'], function() {
			var $ = layui.jquery;

			$("#btn_save").on('click', function() {
				send_form('form_data', "{:url('save')}", '', function() {

				});
			});
		});

	</script>
</block>